﻿<?php 
//error_reporting(E_ERROR|E_PARSE);
session_start();
if($_SESSION["islogin"]!=='igiveyouthepower'){
echo "<script language=JavaScript>\r\n";
echo "alert('请先登录!');\r\n";
echo "location.href='../index.php'\r\n";
echo "</script>";
}else{
require_once('../config.php');
?>
<?php 
$conn = mysqli_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd,$cfg_dbname);
$id=intval($_GET["id"]);
$user_name=$_POST["user_name"];
$platform=$_GET["platform"];
$query="select * from ph_bcategory where where ID='".$id."'";
$result=mysqli_query($conn,$query);
$row=mysqli_fetch_array($result);
$sql = "update ph_bcategory set user_name='".$user_name."' where ID='".$id."'";
mysqli_query($conn,$sql);
$sql = "update ph_products set user_name='".$user_name."' where user_name='".$_SESSION["managername"]."' and bname='".$row["bname"]."'";
mysqli_query($conn,$sql);
echo "<script language=JavaScript>\r\n";
echo "alert('转移成功!');\r\n";
echo "location.href='bigcategory.php?platform=".$platform."'\r\n";
echo "</script>";
?>
<?php }?>